
import '@@/utils/setFontSize'
import '@@/utils/track.js'
import 'vant/lib/index.css';
import App from './App.vue'
import { createApp } from 'vue'
import { createVueState } from '@@/store/index.js'
import { SDKPostMessage } from '@@/utils/common.js'
import { registerComponents } from '@@/components/registerComponents'
import { registerTranslate } from '@@/i18n/translate/index.js'
import { registerRouter } from './router/index.js'
import { registerStore } from '@@/store/registerStore'
import { registerEventCenter } from '@@/utils/EventCenter.js'
import { registerTrack } from '@@/utils/track'
import { initSdkEvents } from './utils/AndroidEvent.js'

const app = createApp(App)
const vueState = createVueState()
window.SDKPostMessage = SDKPostMessage

registerEventCenter()    //EventCenter
registerStore(app,vueState)    //全局变量

window.$EventCenter.createdSdkEventListeners([
    'ad_show',
    'ad_open_page',
    'ad_config_h5',
    'ad_back_req',
    'ad_callback_h5',
    'ad_download_info',
    'ad_avatar_callback'
]) // 集合注册监听器
initSdkEvents({ eventCenter: window.$EventCenter, vueState })
window.SDKPostMessage({
    event: 'h5_ready',
})
registerTranslate(app)   //多语言
registerComponents(app)    //组件注册
registerRouter(app)        //路由注册
registerTrack()
// vueState.EventEmitter.immediately('afterRegist',,vueState.pageStatus.afterRegist)
// 
app.mount('#app') 


